﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;

namespace Prueba.ViewModel.Converters
{
    public class ColumnVisibleConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            object convertedValue = null;
            if (targetType == typeof(System.Windows.Visibility))
            {
                try
                {
                    bool visible = (bool)value;

                    if (visible)
                    {
                        convertedValue = Visibility.Visible;
                    }
                    else
                    {
                        convertedValue = Visibility.Collapsed;
                    }
                }
                catch (Exception)
                {
                    
                    throw;
                }

            }
            return convertedValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
